/*
 * Pl.h
 *
 *  Created on: Nov 2, 2020
 *      Author: root
 */

#ifndef PL_H_
#define PL_H_
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <getopt.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <malloc.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/mman.h>
#include <sys/ioctl.h>


const int PS_TO_PL_H_SignalType          = 0x0100;


//#define DMA_TYPE        'D'
//#define DMA_START_TX     _IO(DMA_TYPE,1)
//#define DMA_START_RX     _IO(DMA_TYPE,2)

class Pl {
public:
	Pl();
	virtual ~Pl();
	int AXI_Lite_Init();
	int AXI_Lite_Read(int addr,float &value);
	int AXI_Lite_Read(int addr,unsigned int &value);

	int AXI_Lite_Write(int addr,float value);
	int AXI_Lite_Write(int addr,int value);
	int AXI_Lite_Write(int addr,unsigned int value);
	int AXI_Lite_Close();




private:
	int m_AxiLite_fd;
	unsigned int *m_AxiLite_MapBase;

};

extern Pl *g_pl_axilite;


#endif /* PL_H_ */
